package controller

import (
	"context"
	"xr-game-server/core/event"
	"xr-game-server/core/httpserver"
	"xr-game-server/core/xrjson"
	"xr-game-server/dto/sysdto"
	"xr-game-server/gameevent"
)

type Sys struct {
}

func initSys() {
	httpserver.RegAPI("/sys", new(Sys))
}

func (receiver *Sys) FlushJson(ctx context.Context, req *sysdto.FlushJsonReq) (res *sysdto.FlushJsonResp, err error) {
	xrjson.Init()
	event.Pub(gameevent.LoadCfgFinishEvent, gameevent.NewLoadCfgFinishEventData())
	return &sysdto.FlushJsonResp{}, nil
}
